home *** CD-ROM | disk | FTP | other *** search
- #pragma once
- //
- // class movingnoisedots generates random dots which move at a given speed
- // in random directions which very at every timestep.
- //
- class movingnoisedots : public dotcollection,
- public phaser, public screendots
- {
- public:
-
- movingnoisedots( int numbits, int xpos, int ypos,
- int aantaldots, int lifetime, int noiseBits);
- movingnoisedots( int numbits, screen_position where,
- int aantaldots, int lifetime, int noiseBits);
-
- protected:
-
- virtual void compute_addresses();
-
- private:
- const unsigned long noiseMask;
- const unsigned long noiseShift;
-
- void move_the_dots();
- //
- // we use 'short_long_hack' to split an unsigned long in two
- // signed shorts (the unsigned long being returned by randomizer_step())
- // (could move these to 'dotcollection' and add a member 'uniformize')
- //
- typedef struct two_shorts
- {
- short left;
- short right;
- };
-
- typedef union short_long_hack
- {
- two_shorts shorties;
- unsigned long ulong;
- };
- };
-